<form id="specForm" class="tableform" action="index.php?app=starbuy&ctl=admin_promotions_type&act=save_type&p[0]=1" method="POST">

<input type="hidden" name="typedata[type_id]" value="<{$typedata.type_id}>">
<div class="division">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
  <th><em class="red">*</em><{t}>类型名称：<{/t}></th>
  <td><{input type="text" name="typedata[name]" vtype="required" value=$typedata.name  maxlength='5'}></td>
</tr>
<!--
<tr>
  <th><{t}>类型描述：<{/t}></th>
  <td><{input type="text" name="typedata[description]" value=$typedata.description}></td>
</tr>
-->
</table>

<div class="table-action">
    <{button label=$___b2c="保存"|t:'b2c' type="submit" class="btn-primary"}>
</div>

</form>
<script>

$('specForm').store('target',{
    onComplete:function(rs){
        if(!rs) return;
        rs = JSON.decode(rs);
        if(rs.success){
            if(window.finderGroup) window.finderGroup['<{$env.get.finder_id}>'].refresh();
            if($('specForm').getParent('.dialog')){
              var Dlg = $('specForm').getParent('.dialog').retrieve('instance');
              if(Dlg.update){
                  Dlg.update.retrieve('instance').initContent();
              }
              Dlg.close();
            }
        }
    }
});
</script>
